function gotoPage(threadID, forumID, numReplies) {
  var postsPerPage = 42;
  var totalPages = Math.ceil(numReplies / postsPerPage);
  var pageNumber = prompt("Enter a page between 1 and " + totalPages, "");
  if (pageNumber !== null && pageNumber > 0 && pageNumber <= totalPages) {
  	var baseurl = "thread?id=" + threadID + "&forumID=" + forumID + "&numReplies=" + numReplies + "&start=";
    location.href = baseurl + ((pageNumber - 1) * postsPerPage);
  } else {
    return false;
  }
}